<h2><?php echo $this->modelTitle ?></h2>

<h3><?php echo $this->_('Comments, Descriptions and Notes') ?></h3>
<?php if ($this->has('infoPredicates')): ?>
    <?php foreach ($this->infoPredicates as $uri => $predicate): ?>
        <?php foreach ($this->values[$uri] as $entry): ?>
            <p class="messagebox info"><?php echo trim($entry['object']) ?></p>
        <?php endforeach; ?>
    <?php endforeach; ?>
<?php else: ?>
    <p class="messagebox warning"><?php echo $this->_('There are no comments, descriptions or notes on this knowledge base.') ?></p>
<?php endif; ?>
<!--h3><?php echo $this->_('Statistical Outline') ?></h3>
<table class="separated-vertical">
    <tr class="odd">
        <td width="25%">Classes</td>
        <td>23 (Defined: 23, Imported: 0)</td>
    </tr>
    <tr>
        <td width="25%">Datatype Properties</td>
        <td>23 (Defined: 23, Imported: 0)</td>
    </tr>
    <tr class="odd">
        <td width="25%">Object Properties</td>
        <td>23 (Defined: 23, Imported: 0)</td>
    </tr>
    <tr>
        <td width="25%">Annotation Properties</td>
        <td>23 (Defined: 23, Imported: 0)</td>
    </tr>
    <tr class="odd">
        <td width="25%">Individuals</td>
        <td>23 (Defined: 23, Imported: 0)</td>
    </tr>
</table-->

<?php $odd = true; ?>
<h3><?php echo $this->_('Properties') ?></h3>
<?php if ($this->has('predicates')): ?>
<table class="separated-vertical rdfa" about="<?php echo $this->resourceIri ?>"
    <?php foreach ($this->namespacePrefixes as $prefix => $namespace): ?>
        <?php echo ' xmlns:' . $prefix . '="' . $namespace . '"' ?>
    <?php endforeach; ?>>
    <?php foreach ($this->predicates as $uri => $predicate): ?>
        <tr class="<?php echo $odd ? 'odd' : 'even'; $odd = !$odd; ?>">
            <td width="25%">
                <a class="hasMenu" about="<?php echo $this->predicates[$uri]['uri'] ?>" href="<?php echo $this->predicates[$uri]['url'] ?>"><?php echo $this->predicates[$uri]['title'] ?></a>
            </td>
            <?php if (count($this->values[$uri]) > 1): ?>
            <td>
                <ul class="bullets-none">
                    <?php foreach ($this->values[$uri] as $entry): ?>
                        <?php if ($entry['url']): ?>
                            <li>
                                <a resource="<?php echo $entry['uri'] ?>" rel="<?php echo $this->predicates[$uri]['curi'] ?>" class="expandable hasMenu" href="<?php echo $entry['url'] ?>">
                                    <?php echo $entry['object'] ?>
                                </a>
                            </li>
                        <?php else: ?>
                            <li property="<?php echo $this->predicates[$uri]['curi'] ?>" 
                                <?php if (isset($entry['datatype']) && !empty($entry['datatype'])): ?>
                                    datatype="<?php echo $entry['datatype'] ?>"
                                <?php endif; ?>
                                ><?php 
                                echo $entry['object'] 
                            ?></li>
                        <?php endif; ?>
                    <?php endforeach; ?>
                    <?php if ($this->predicates[$uri]['has_more']): ?>
                        <a href="">&hellip;</a>
                    <?php endif; ?>
                </ul>
            </td>
            <?php else: ?>
            <td>
                <?php if ($this->values[$uri][0]['url']): ?>
                    <?php if ($this->values[$uri][0]['uri']): ?>
                        <a rel="<?php echo $this->predicates[$uri]['curi'] ?>" class="expandable hasMenu" resource="<?php echo $this->values[$uri][0]['uri'] ?>" href="<?php echo $this->values[$uri][0]['url'] ?>">
                            <?php echo $this->values[$uri][0]['object'] ?>
                        </a>
                    <?php else: ?>
                        <a rel="<?php echo $this->predicates[$uri]['curi'] ?>" href="<?php echo $this->values[$uri][0]['url'] ?>">
                            <?php echo $this->values[$uri][0]['object'] ?>
                        </a>
                    <?php endif; ?>
                <?php else: ?>
                    <span property="<?php echo $this->predicates[$uri]['curi'] ?>" 
                          content="<?php echo $this->values[$uri][0]['content'] ?>" 
                          <?php if (isset($this->values[$uri][0]['datatype']) && !empty($this->values[$uri][0]['datatype'])): ?>
                              datatype="<?php echo $this->values[$uri][0]['datatype'] ?>"
                          <?php endif; ?>
                    ><?php echo $this->values[$uri][0]['object'] ?></span>
                <?php endif; ?>
            </td>
            <?php endif; ?>
        </tr>
    <?php endforeach; ?>
</table>
<?php else: ?>
    <p class="messagebox info"><?php echo $this->_('No predicates found.') ?></p>
<?php endif; ?>


<div class="messagebox">
<h4><?php echo $this->_('Actions') ?></h4>
<?php
if($this->has('showFoafLink') && $this->showFoafLink){
    ?><a href="<?php echo $this->foafLink; ?>">open FOAF viewer</a><br/><?php
}
?>
<a href="<?php echo $this->resourcesUrl; ?>"> <?php echo $this->_('view all resources') ?></a>&nbsp;|&nbsp;

<a onclick="$('#location_bar_container').toggle()" > <?php echo $this->_('Jump to resource') ?></a>

<div id="location_bar_container" style="display: none; padding: 10px 0px 10px 20px; border-top: 1px dotted #ababab;">
  <h5><?php echo $this->_('Jump to resource') ?></h5>
  <input id="location_bar_input" class="text width75" type="text" value="" name="l" />
  <a id="location_open" class="minibutton" style="float: none"> <?php echo $this->_('View Resource') ?> </a>
</div>


</div>
